/*
 * Copyright (C) 2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef AVCODECLIST_PARCEL_H
#define AVCODECLIST_PARCEL_H

#include <vector>
#include "message_parcel.h"
#include "avcodec_info.h"

namespace OHOS {
namespace MediaAVCodec {
class CodecListParcel {
public:
    CodecListParcel() = delete;
    ~CodecListParcel() = delete;

    static bool Marshalling(MessageParcel &parcel, CapabilityData &capabilityData);
    static bool Marshalling(MessageParcel &parcel, const std::map<ImgSize, Range> &mapSizeToRange);
    static bool Marshalling(MessageParcel &parcel, const std::map<int32_t, std::vector<int32_t>> &mapIntToVec);
    static bool Marshalling(MessageParcel &parcel, const std::map<int32_t, Format> &mapIntToFormat);
    static bool Marshalling(MessageParcel &parcel, const std::vector<Range> &audioSampleRateRanges);
    static bool MarshallingInt32Vector(MessageParcel &parcel, CapabilityData &capabilityData);

    static bool Unmarshalling(MessageParcel &parcel, CapabilityData &capabilityData);
    static bool Unmarshalling(MessageParcel &parcel, std::map<ImgSize, Range> &mapSizeToRange);
    static bool Unmarshalling(MessageParcel &parcel, std::map<int32_t, std::vector<int32_t>> &mapIntToVec);
    static bool Unmarshalling(MessageParcel &parcel, std::map<int32_t, Format> &mapIntToFormat);
    static bool Unmarshalling(MessageParcel &parcel, std::vector<Range> &audioSampleRateRanges);
    static bool UnmarshallingInt32Vector(MessageParcel &parcel, CapabilityData &capabilityData);
};
} // namespace MediaAVCodec
} // namespace OHOS
#endif // MEDIA_PARCEL_H
